package com.example.fly.pushdemo.smack.extension;

import org.jivesoftware.smack.packet.PacketExtension;

/**
 * Created by fly on 2017/4/13.
 *
 * just for close door
 */

public class CloseExt implements PacketExtension {

    private String token;
    private String ordernumber;

    public String getOrdernumber() {
        return ordernumber;
    }

    public void setOrdernumber(String ordernumber) {
        this.ordernumber = ordernumber;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }


    @Override
    public String getElementName() {
        return "query";
    }

    @Override
    public String getNamespace() {
        return "urn:ltb:device:close";
    }

    @Override
    public String toXML() {
        StringBuilder sb = new StringBuilder();
        sb.append("<");
        sb.append(getElementName());
        sb.append(" xmlns = \"" + getNamespace() + "\"");
        sb.append(">");

        sb.append("<token>");
        sb.append(getToken());
        sb.append("</token>");

        sb.append("<ordernumber>");
        sb.append(getOrdernumber());
        sb.append("</ordernumber>");
        sb.append("</");
        sb.append(getElementName());
        sb.append(">");
        return sb.toString();
    }
}
